﻿#ifndef PUSHBUTTONSWITCH_H
#define PUSHBUTTONSWITCH_H

#include <QWidget>
#include "PushButton.h"
#include "ui_base_lib_global.h"
typedef struct tagSwitchButtonInfo
{
    int trueValue;
    int falseValue;

    bool isChecked;
}SwitchButtonInfo;

class UI_BASE_LIBSHARED_EXPORT PushButtonSwitch : public PushButton
{
    Q_OBJECT
public:
    explicit PushButtonSwitch(QWidget *parent = nullptr);
    explicit PushButtonSwitch(int id,QWidget *parent = nullptr);
     void initStyleSheet(QString str);
 static void initButton(PushButtonSwitch* p , QString str , int x , int y , int w , int h , QString strOn, QString strOff, SwitchButtonInfo info);
    void setButtonText(QString str);

    int getValue();
    void setValue(uint8_t flag);
    int getAttributeID();

    void changeOn();
    void changeOff();

    bool m_flag;
    QString m_strOn;
    QString m_strOff;

    int m_trueValue;
    int m_falseValue;	
signals:


    void evt_valueChanged();

public slots:
        void on_click();
};

#endif 
